# -*- coding: utf-8 -*-
# @Time    : 2019/12/3 2:24 下午
# @Author  : CHENlj
# @File    : test.py

import pytest, allure, json, ast, os
from Common.Request import Request
from Common.Excel import HandleExcel
from Common.Assert import Assert

at = Assert()
handle_excel = HandleExcel()
df = handle_excel.read_df('template.xlsx', header=None, sheet_name=0)

# 接口描述
api_desc = df.iloc[0, 1]
# 接口地址
api_url = df.iloc[1, 1]
# 获取token
token = 'Bearer ' + df.iloc[2, 1]
# 获取请求方式
req_type = df.iloc[3, 1]
# 获取请求头
header = df.iloc[4, 1]
header = ast.literal_eval(header)
header['a'] = token

if __name__ == '__main__':
    # print(header)
    # print(type(header))

    # ret = os.path.isfile('/Users/lldxwn/Desktop/接口测试.pptx')
    # print(ret)
    # 项目目录
    project_path = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir))
    # data文件夹路径
    data_path = os.path.join(project_path, 'Data')
    # 当前目录路径，当前路径下的所有子目录， 当前路径下所有非目录子文件
    for root, dirs, files in os.walk(data_path):
        print(files)
